home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / zuck / tasklist.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-06  |  1.8 KB  |  62 lines

  1. VERSION 2.00
  2. Begin Form TaskListForm 
  3.    Caption         =   "Task List and List Tabstops"
  4.    ClientHeight    =   3330
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   4725
  8.    Height          =   3735
  9.    Left            =   1035
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   540
  12.    ScaleWidth      =   540
  13.    Top             =   1140
  14.    Width           =   4845
  15.    Begin ListBox lst_Task 
  16.       Height          =   2565
  17.       Left            =   240
  18.       TabIndex        =   1
  19.       Top             =   540
  20.       Width           =   2715
  21.    End
  22.    Begin CommandButton Cmd_Ok 
  23.       Caption         =   "Ok"
  24.       Height          =   555
  25.       Left            =   3360
  26.       TabIndex        =   0
  27.       Top             =   2520
  28.       Width           =   1035
  29.    End
  30.    Begin Label Label1 
  31.       Caption         =   "Task names,  Task Handles"
  32.       Height          =   255
  33.       Left            =   240
  34.       TabIndex        =   2
  35.       Top             =   240
  36.       Width           =   2715
  37.    End
  38. Option Explicit
  39. Sub Cmd_Ok_Click ()
  40.     Unload Me
  41. End Sub
  42. Sub Form_Load ()
  43.     ReDim tablist%(2)
  44.     Dim tabposition%
  45.     Dim dl&
  46.     Dim ts As TASKENTRY
  47.     Dim taskfound%
  48.     tabposition% = 15
  49.     ' Note that dialog units are 4* the average char width
  50.     tablist%(0) = tabposition% * 4
  51.     ' We place a second tab stop - but we won't be
  52.     ' using it in this example.
  53.     tablist%(1) = (tabposition% + 5) * 4
  54.     dl& = SendMessage(lst_Task.hWnd, LB_SETTABSTOPS, 2, tablist%(0))
  55.     ts.dwSize = Len(ts)   ' Very important!  Initialize size
  56.     taskfound% = TaskFirst(ts)
  57.     Do While taskfound% <> 0
  58.         lst_Task.AddItem NullTermToVBString(ts.szModule) & Chr$(9) & FormattedHex$(ts.hTask, 4)
  59.         taskfound% = TaskNext(ts)
  60.     Loop
  61. End Sub
  62.